package com.eliza.lifecycle.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.lifecycle.ProcessLifecycleOwner
import com.eliza.lifecycle.R
import com.eliza.lifecycle.observer.NewDefaultLcObserver
import com.eliza.lifecycle.observer.NoteLcObserver

class ObserverActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_lifecycle_observer)


        /**
         * ProcessLifecycleOwner 监听
        * */
        ProcessLifecycleOwner.get().lifecycle.addObserver(
            NoteLcObserver()
        )
        ProcessLifecycleOwner.get().lifecycle.addObserver(
            NewDefaultLcObserver()
        )


    }
}